import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("menu_pkey", ["id"], { unique: true })
@Entity("menu", { schema: "public" })
export class Menu {
  @PrimaryGeneratedColumn({ type: "smallint", name: "id" })
  id: number;

  @Column("character varying", {
    name: "name",
    length: 30,
    default: () => "''",
  })
  name: string;

  @Column("character varying", {
    name: "type",
    length: 10,
    default: () => "''",
  })
  type: string;

  @Column("character varying", {
    name: "path",
    length: 30,
    default: () => "''",
  })
  path: string;

  @Column("character varying", {
    name: "component",
    length: 50,
    default: () => "''",
  })
  component: string;

  @Column("character varying", {
    name: "permission",
    length: 100,
    default: () => "''",
  })
  permission: string;

  @Column("character varying", {
    name: "api",
    length: 100,
    default: () => "''",
  })
  api: string;

  @Column("character varying", {
    name: "api_method",
    length: 10,
    default: () => "''",
  })
  apiMethod: string;

  @Column("boolean", { name: "keep_alive", default: () => "false" })
  keepAlive: boolean;

  @Column("boolean", { name: "display", default: () => "false" })
  display: boolean;

  @Column("boolean", { name: "enable", default: () => "false" })
  enable: boolean;

  @Column("smallint", { name: "sort", default: () => "0" })
  sort: number;

  @Column("smallint", { name: "parent_id", default: () => "0" })
  parentId: number;
}
